package com.luych.toolbox.docker.service.dao;

import com.luych.toolbox.common.enums.DockerServerStatus;
import com.luych.toolbox.docker.service.entity.DockerServer;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;

public interface DockerServerDao extends JpaRepository<DockerServer, String>, JpaSpecificationExecutor<DockerServer> {

    Optional<DockerServer> findByName(String name);

    List<DockerServer> findByStatus(DockerServerStatus status);

    Page<DockerServer> findByNameLikeOrUrlLike(String name, String url, Pageable pageable);

}